% fd=@(p) sqrt(sum(p.^2,2))-1;

global tri;

tri = [1 3 2; 1 2 4; 1 4 3; 2 3 4];
pv = [0 0 0; 1 0 0; 0 1 0; 0 0 1];
[p,t]=distmeshnd(@myPoly,@huniform,0.15,[-1,-1,-1;1,1,1],pv, pv);

%   Write Coordinates File

% index = [1:size(p,1)];
% coordinates = [index;p']';
% save('coordinates.dat', 'coordinates', '-ASCII');


%   Write Elements File

% index = [1:size(t,1)];
% elements = [index;t']';
% save('elements.dat', 'elements', '-ASCII');
